<!--待审核的个人客户-->
<template>
    <div>
        <el-tabs v-model="activeName2" type="card" >
            <el-tab-pane label="个人信息" name="first">
                <!--<p>当前用户版本7</p>-->
                <!--修改历史记录内容-->
                <el-dialog title="修改记录" :visible.sync="dialog.showHistory.open" size="large"
                           v-if="dialog.showHistory.open" :modal=false>
                    <el-row :gutter="20">
                        <el-col :span="3"><span>版本号</span></el-col>
                        <el-col :span="3"><span>编辑人</span></el-col>
                        <el-col :span="3"><span>提交时间</span></el-col>
                        <el-col :span="3"><span>审核时间</span></el-col>
                        <el-col :span="3"><span>审核结果</span></el-col>
                        <el-col :span="3">审核人</el-col>
                        <el-col :span="3">操作</el-col>
                    </el-row>
                    <el-row :gutter="20" style="padding: 20px 0">
                        <el-col :span="3"><span>1</span></el-col>
                        <el-col :span="3"><span>李文龙</span></el-col>
                        <el-col :span="3"><span>2016-07-07</span></el-col>
                        <el-col :span="3"><span>2017-07-07</span></el-col>
                        <el-col :span="3"><span>通过</span></el-col>
                        <el-col :span="3">袁裕国</el-col>
                        <el-col :span="3">查看此版本</el-col>
                    </el-row>
                </el-dialog>
                <div class="block">
                      <span class="wrapper" style="padding-bottom: 20px">
                        <el-button type="success" @click="nopass(2)">审核通过</el-button>
                        <el-button type="warning" @click="nopass(3)">不通过</el-button>
                          <!--<el-button type="info" @click="openDialog('showHistory')">查看历史版本</el-button>-->
                      </span>
                </div>
                <el-row>
                    <!--<el-col :span="2"><span>版本编辑人:</span></el-col>-->
                    <!--<el-col :span="2"><span>{}</span></el-col>-->
                    <el-col :span="2"><span>客户经理:</span></el-col>
                    <el-col :span="2"><span>{{form.transcript_belong}}</span></el-col>
                </el-row>
                <el-row>
                    <el-col :span="2"><span>提交时间：</span></el-col>
                    <el-col :span="5"><span>{{form.create_time}}</span></el-col>
                </el-row>
                <!--<el-row>-->
                    <!--<el-col :span="3"><span>编辑人备注：</span></el-col>-->
                    <!--<el-col :span="20"><p>-->
                        <!--{{form.content}}-->
                    <!--</p></el-col>-->
                <!--</el-row>-->
                <el-row>
                    <el-col :span="6"><h2>个人资料</h2></el-col>
                </el-row>
                <el-row>
                    <el-col :span="22">
                        <ul>
                            <li><span class="mainListSty2">姓名*</span><span>{{form.transcript_name}}</span></li>
                            <li><span class="mainListSty2">手机号（联系电话）</span><span>{{form.transcript_mobile}}</span></li>
                            <li><span class="mainListSty2">领域*</span><span v-for="item in form.transcript_field" style="line-height: 50px">{{item}}</span></li>
                            <li><span class="mainListSty2">角色</span><span  v-for="item in form.transcript_role" >{{item}}</span></li>
                            <li><span class="mainListSty2">性别</span><span v-if="form.transcript_sex==1">男</span><span v-else>女</span></li>
                        </ul>
                    </el-col>
                    <!--<el-col :span="6"><div style="width:100px;height:100px;background: gray">logo</div></el-col>-->
                </el-row>
                <!--能力画像-->
                <h4>总体描述</h4>
                <div style="margin:0 auto;width:90%">
                    <script id="editor" type="text/plain"></script>
                </div>

                <!--<h4>关系网</h4>-->
                <!--<el-form :inline="true" :model="form" class="demo-form-inline" style="border-bottom: 1px dashed gray">-->
                    <!--<el-form-item label="关系单位">-->
                        <!--建筑公司-->
                    <!--</el-form-item>-->
                    <!--<el-form-item label="任职">-->
                        <!--CEO-->
                    <!--</el-form-item>-->
                    <!--<el-form-item label="服务偏好">-->
                        <!--承建-->
                    <!--</el-form-item>-->
                <!--</el-form>-->
                <!--<el-form :inline="true" :model="form" class="demo-form-inline" style="border-bottom: 1px dashed gray">-->
                    <!--<el-form-item label="关系单位">-->
                        <!--文化公司-->
                    <!--</el-form-item>-->
                    <!--<el-form-item label="任职">-->
                        <!--CEO-->
                    <!--</el-form-item>-->
                    <!--<el-form-item label="服务偏好">-->
                        <!--文化传播-->
                    <!--</el-form-item>-->
                <!--</el-form>-->
            </el-tab-pane>
            <!--附件栏内容编辑-->
            <!--<el-tab-pane label="附件栏" name="fourth">-->
                <!--&lt;!&ndash;照片&ndash;&gt;-->
                <!--<el-form  class="demo-form-inline" label-width="100px" :label-position="position">-->
                    <!--<el-form-item label="照片">-->
                        <!--<el-upload-->
                                <!--:disabled="forbidden"-->
                                <!--class="upload-demo"-->
                                <!--:action="fileUploadAction"-->
                                <!--:before-upload="beforeUpload0"-->
                                <!--:file-list="fileList0">-->
                            <!--<el-button size="small" type="primary">附件</el-button>-->
                        <!--</el-upload>-->
                    <!--</el-form-item>-->
                    <!--&lt;!&ndash;名片&ndash;&gt;-->
                    <!--<el-form-item label="名片">-->
                        <!--<el-upload-->
                                <!--:disabled="forbidden"-->
                                <!--class="upload-demo"-->
                                <!--:action="fileUploadAction"-->
                                <!--:file-list="fileList1">-->
                            <!--<el-button size="small" type="primary">附件</el-button>-->
                        <!--</el-upload>-->
                    <!--</el-form-item>-->
                    <!--&lt;!&ndash;其他附件&ndash;&gt;-->
                    <!--<el-form-item label="其他附件">-->
                        <!--<el-upload-->
                                <!--:disabled="forbidden"-->
                                <!--class="upload-demo"-->
                                <!--:action="fileUploadAction"-->
                                <!--:file-list="fileList2">-->
                            <!--<el-button size="small" type="primary">附件</el-button>-->
                        <!--</el-upload>-->
                    <!--</el-form-item>-->
                <!--</el-form>-->
            <!--</el-tab-pane>-->
        </el-tabs>
    </div>
</template>
<script>
    import Bus from '@/config/bus.js'
    import _http from '@/components/common/http.vue'
    import _param from '@/components/common/param.vue'
    import '@/assets/ueditor/ueditor.config.js'
    import '@/assets/ueditor/ueditor.all.min.js'
    import '@/assets/ueditor/ueditor.parse.min.js'
    import '@/assets/ueditor/lang/zh-cn/zh-cn.js'
    export default {
        data() {
            return {
                apiPort:{
                    checkBtnapi:'transcript/personal/updateCheckFlag',
                    personDetail:'transcript/personal/getById',
                    delData:'doPeopleVerify'
                },
                fieldBox:[],
                fieldNum:"",
                roleNum:'',
                roleBox:[],
                roleList:[],
                fieldList:[],
                param:{
                    params:{
                        id:''
                    }
                },
                form:{},
                forbidden:true,
                position:'left',
                //    照片
                fileList0:[],
//                名片
                fileList1:[],
//                其他
                fileList2:[],
                limit:'',
                userid:'',
//
                dialog:{
                    showHistory:{
                        open:false
                    }
                },
                activeName2: 'first',
                id:'',
            }
        },
        mounted(){
            this.limit = JSON.parse(localStorage.getItem("limitList"))
            var that = this
            this.userid=localStorage.getItem('userId')

            var that = this
            Bus.$on('sentData',function(val){
                that.form.userid = localStorage.getItem('userId')
                that.id=val
                var param = {transcript_id:val,userid:that.userid}
                var params = that.querystring.stringify(param)
                _http.axiosRequest(that,that.apiPort.personDetail,params,(res)=>{
                    console.log('性别测试')
                    console.log(res.data.data)
                that.form=res.data.data
                that.editor.setContent(that.form.transcript_description)

                UE.getEditor('editor').setDisabled('fullscreen');

            })
        })
            this.editor = UE.getEditor('editor',{toolbars:[[
            ]],initialFrameHeight:300});

    },
  methods:{
      nopass(val){
          var that = this
          var param = {transcript_id:that.id,transcript_flag:val,userid:that.userid}
          var params = that.querystring.stringify(param)
          _http.axiosRequest(that,that.apiPort.checkBtnapi,params,(res)=>{
              console.log(res)
          if(res.data.code==100){
              that.handleEdit()
              that.$message({
                  message: '操作成功',
                  type: 'success'
              });
          }
          else{
              that.$message({
                  message:res.data.msg,
                  type: 'warning'
              });
          }
      })
      },
      handleEdit(){
          setTimeout(function(){
              Bus.$emit('sendflagM',1)
          },200);
      },

   },

  beforeDestroy(){
            Bus.$off("sentData")
        },
        destroyed() {
            this.editor.destroy();
        },

    }
</script>
<style>
    ul li{
        list-style: none;
        margin-top: 20px;
    }
    .listSty{
        display:inline-block;
        width: 150px;
        margin-left:-30px;
    }
    .mainListSty2{
        display:inline-block;
        width: 150px;
        margin-left:-30px;
    }
    .able:after{
        content: "√";
        color: #6ce26c;
    }
</style>